//
//  PerQAViewController.m
//  CYWFrame
//
//  Created by Macx on 2017/12/4.
//  Copyright © 2017年 Macx. All rights reserved.
//

#import "PerQAViewController.h"
#import "CCZSegementController2.h"
#import "QAZoneViewController.h"

@interface PerQAViewController ()

@end

@implementation PerQAViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    QAZoneViewController *qa1 = [[QAZoneViewController alloc] init];
    QAZoneViewController *qa2 = [[QAZoneViewController alloc] init];
    
    qa1.type = 1;
    qa2.type = 2;
    
    qa1.user_id = self.user_id;
    qa2.user_id = self.user_id;
    
    NSArray *vcArr = @[qa1, qa2];
    NSArray *name = @[@"用户提问", @"用户回答"];
    
    CCZSegementController2 *segement = [CCZSegementController2 segementControllerWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) titles:name];
    [segement setSegementViewControllers:vcArr];
    
    segement.style = CCZSegementStyleDefault;
    [segement setSegementTintColor:UIMainColorRGB];
    [self.view addSubview:segement.view];
    [self addChildViewController:segement];
    [segement selectedNavAtIndex:^(NSInteger index) {
        NSLog(@"index %ld",index);
    }];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
